package route

import (
	"github.com/gin-gonic/gin"
	gs "github.com/swaggo/gin-swagger"
	"github.com/swaggo/gin-swagger/swaggerFiles"
	"goWebTest/goGinWebJwtTest/jwt"
	"goWebTest/goGinWebTest/apis"
)

type As struct {
	//namespace string `json:"namespace,omitempty"`
}

func GetGinData() *gin.Engine {
	r := gin.New()
	r.Use(gin.Logger())

	r.Use(gin.Recovery())

	////配置组，用于基本参数设置与读取
	userAPI := r.Group("/api/user/")
	// 加载自定义的JWTAuth()中间件,在整个sv1的路由组中都生效
	uApi := &apis.UserAPI{}
	if 1 == 0 {
		userAPI.Use(jwt.JWTAuth())
	}
	{
		userAPI.GET("/listUser", uApi.ListUser) //用户列表
	}

	r.GET("/swagger/*any", gs.WrapHandler(swaggerFiles.Handler)) //swagger

	return r
}
